#!/bin/bash
MQ_VERSION=5.13.0
unzip -q apache-activemq-$MQ_VERSION.zip -d /usr/local/
ACTIVEMQ_HOME=/usr/local/apache-activemq-$MQ_VERSION
if [[ ! -d "ACTIVEMQ_HOME" ]]; then
	echo "ERROR! ACTIVEMQ_HOME is not found!"
	exit -1
fi

echo "export ACTIVEMQ_HOME=$ACTIVEMQ_HOME" >> /etc/profile
echo "export PATH=\$PATH:\$ACTIVEMQ_HOME/bin" >> /etc/profile
source /etc/profile
echo "starting activemq..."
activemq start
